package com.sepro.dao.impl;

import org.springframework.stereotype.Repository;

import com.sepro.dao.AdminDao;
import com.sepro.entity.Admin;

@Repository("adminDaoImpl")
public class AdminDaoImpl extends BaseDaoImpl<Admin, String> implements
		AdminDao {

	@SuppressWarnings("unchecked")
	public Admin getAdminByUsername(String username) {
		String hql = "from Admin as admin where lower(admin.username) = lower(:username)";
		return (Admin) getSession().createQuery(hql).setParameter("username", username).uniqueResult();
	}

}
